package com.jianneng.jdg.model.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.Toast;

import com.example.com.jianneng.jdg.R;
import com.jianneng.jdg.model.homeactivity.ActivitiesActivity;
import com.jianneng.jdg.model.homeactivity.FindFriendActivity;
import com.jianneng.jdg.model.homeactivity.FindHelpActivity;
import com.jianneng.jdg.model.homeactivity.MainActivity;
import com.jianneng.jdg.model.homeactivity.MyNewActivity;
import com.jianneng.jdg.model.homeactivity.ReportMoneyActivity;

public class FragmentEntrance extends Fragment implements OnClickListener {
	private ImageView iv_findfriend, iv_findhelp, iv_checkmoney, iv_email,
			iv_play;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.fragment_entrance, container,
				false);
		// 快捷入口的点击事件
		iv_findfriend = (ImageView) view
				.findViewById(R.id.iv_entrance_findfriend);
		iv_findhelp = (ImageView) view.findViewById(R.id.iv_entrance_findhelp);
		iv_checkmoney = (ImageView) view
				.findViewById(R.id.iv_entrance_checkmoney);
		iv_play = (ImageView) view.findViewById(R.id.iv_entrance_activity);
		iv_email = (ImageView) view.findViewById(R.id.iv_entrance_email);

		iv_findfriend.setOnClickListener(this);
		iv_findhelp.setOnClickListener(this);
		iv_checkmoney.setOnClickListener(this);
		iv_email.setOnClickListener(this);
		iv_play.setOnClickListener(this);

		return view;

	}

	@Override
	public void onResume() {
		super.onResume();
	}

	@Override
	public void onPause() {
		super.onPause();
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.iv_entrance_findfriend:// 找老乡
			Intent intentFind = new Intent(getActivity(),
					FindFriendActivity.class);
			startActivity(intentFind);
			break;
		case R.id.iv_entrance_findhelp:// 咨询帮助
			Intent intent =new Intent(getActivity(), MainActivity.class);
			intent.putExtra("id", "2");
			startActivity(intent);
			break;
		case R.id.iv_entrance_checkmoney:// 工资查询
			Toast.makeText(getActivity(), "此功能还未开放！", 1).show();
			break;
		case R.id.iv_entrance_activity:// 活动
			Intent intentAct = new Intent(getActivity(),
					ActivitiesActivity.class);
			startActivity(intentAct);
			break;
		case R.id.iv_entrance_email:// 邮箱
			Intent intentEmal = new Intent(getActivity(), MyNewActivity.class);
			startActivity(intentEmal);
			break;

		default:
			break;
		}

	}

}
